package day03;

public class Rectangle {
    private int length;
    private int width;

    public Rectangle(int width, int length) {
        this.width = width;
        this.length = length;
    }

    public int getArea() {
        return length * width;
    }

    public int getPer() {
        return 2 * (length + width);
    }

    public void showAll() {
        System.out.println("长: " + length);
        System.out.println("宽: " + width);
        System.out.println("面积: " + getArea());
        System.out.println("周长: " + getPer());
    }
    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }
}
